package com.hmall.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.hmall.common.dto.FiltersDTO;
import com.hmall.item.pojo.Item;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ItemMapper extends BaseMapper<Item> {

    @Select("select * from mall_db_item.tb_item")
    Page<Item>pagelist();

    @Select("select brand from mall_db_item.tb_item where category = #{category}")
    List<String> selectBrand(String category);

    Page<Item> page(FiltersDTO filtersDTO);

    @Select("select category from mall_db_item.tb_item")
    List<String> getCategory();
    @Select("select brand from mall_db_item.tb_item")
    List<String> getBrand();
}
